home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
graphic
/
1svga.zip
/
SHOW.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-05-18
|
11KB
|
278 lines
{┌────────────────────────────────────╖
│ VGA Show V1.1 /320x200,256 Colors ║
│ Written by Jou-Nan Chen 1994-05-16 ║
│ Copyright (C) 1994 by Jou-Nan Chen ║
╘════════════════════════════════════╝}
{$M 20000,0,655360}
uses Dos,Show320,SVGA256,Txt;
{ Text,Select,Messege,Box,Title,Show, WinText,Box,Title, HelpText,Box,Title }
const
C1:array[1..12] of byte=($1E,$DF,$F5,$1F,$F1,$18, $2E,$2A,$A5, $3E,$3B,$B5);
C2:array[1..12] of byte=($F0,$DF,$1F,$F1,$1F,$F8, $80,$81,$1F, $DF,$D4,$4F);
Delays:array[0..47] of byte=(
25,20,20,05,05, 12,08,05,08,15, 08,05,05,05,05,
08,03,03,08,08, 10,10,10,10,08, 05,08,03,04,04,
04,04,03,02,02, 03,70,50,50,70, 15,03,06,04,04, 06,12,12);
ShowType:integer=0; No:integer=0;
Page:integer=0; PageSize:integer=85;
var Filenames:array[0..4095] of string[12];
K,Max,PageMax:integer;
Font1:array[0..4095] of byte;
Co:array[1..12] of byte;
{ ─────────────── GetFilenames ─────────────── }
procedure GetFilenames(Path:string);
var DirInfo:SearchRec;
begin
Max:=0; FillChar(Filenames,26624,32);
FindFirst(Path,Archive,DirInfo);
while DosError=0 do begin
FileNames[Max]:=DirInfo.Name;
FileNames[Max,0]:=#12;
FindNext(DirInfo); Inc(Max);
end;
if Max=0 then begin
Writeln; Writeln('Sorry! Can''t find any file!');
Halt(1);
end;
Dec(Max);
end;
{ ─────────────── SortFilenames ─────────────── }
procedure SortFilenames(L,R:integer);
var I,J:integer;
M,T:string[12];
begin
I:=L; J:=R; M:=Filenames[(L+R) shr 1];
repeat
while Filenames[I]<M do Inc(I); { Move right }
while M<Filenames[J] do Dec(J); { Move left }
if I<=J then begin
T:=Filenames[I]; Filenames[I]:=Filenames[J]; Filenames[J]:=T;
Inc(I); Dec(J);
end;
until I>J;
if L<J then SortFilenames(L,J);
if I<R then SortFilenames(I,R);
end;
{ ─────────────── TextWin2 ─────────────── }
procedure TextWin2(X,Y,LenX,LenY,CBox,CTitle,Shadow:integer;Title:string);
var I:integer; { Shadow: 1=With, 0=No }
begin
TextBar(X,Y,LenX,1,CTitle,' ');
PrintText(X+(LenX-Length(Title)) shr 1,Y,CTitle,Title);
TextBar(X,Y+1,1,LenY-2,CBox,'╫');
TextBar(X+LenX-1,Y+1,1,LenY-2,CBox,'╪');
PrintText(X,Y+LenY-1,CBox,'╤');
TextBar(X+1,Y+LenY-1,LenX-2,1,CBox,'╟');
PrintText(X+LenX-1,Y+LenY-1,CBox,'╥');
TextBar(X+1,Y+1,LenX-2,LenY-2,CBox,' ');
if Shadow=1 then TextShadow(X,Y,LenX,LenY);
for I:=0 to 1 do begin
PrintText(X+I,Y,CBox,Chr(193+I));
PrintText(X+I+LenX-2,Y,CBox,Chr(202+I));
end;
end;
{ ─────────────── PrintNum ─────────────── }
procedure PrintNum(X,Y,Color,Num:byte);
var I,N:integer;
begin
N:=100;
for I:=0 to 2 do begin
PrintText(X+I,Y,Color,Chr(128+Num div N mod 10));
N:=N div 10;
end;
end;
{ ─────────────── ShowPic ─────────────── }
procedure ShowPic(Ty,X,Y,LenX,LenY:integer);
var S,O,D:integer;
Pic:pointer;
begin
GetMem(Pic,64768);
FileRead(Filenames[PageSize*Page+No],0,FileLen(Filenames[PageSize*Page+No],1),1,Pic^);
S:=Seg(Pic^); O:=Ofs(Pic^); D:=Delays[Ty];
SetMode(1); SetPalette(0,256,Mem[S:O]); Inc(O,768);
case Ty of
0:ShowBar (X,Y,LenX,LenY,D,Mem[S:O]);
1:ShowBox (1,X,Y,LenX,LenY,D,Mem[S:O]);
2:ShowBox (2,X,Y,LenX,LenY,D,Mem[S:O]);
3:ShowCircle(1,X,Y,LenX,LenY,188,D,Mem[S:O]);
4:ShowCircle(2,X,Y,LenX,LenY,188,D,Mem[S:O]);
5:ShowCell (X,Y,LenX,LenY,8,8,D,Mem[S:O]);
6:ShowClkRnd(X,Y,LenX,LenY,D,Mem[S:O]);
7:ShowClock (X,Y,LenX,LenY,D,Mem[S:O]);
8:ShowClock2(X,Y,LenX,LenY,D,Mem[S:O]);
9:ShowColor (1,X,Y,LenX,LenY,0,256,D,Mem[S:O]);
10:ShowDot (X,Y,LenX,LenY,D,Mem[S:O]);
11:ShowFall (1,X,Y,LenX,LenY,10,D,Mem[S:O]);
12:ShowFall (2,X,Y,LenX,LenY,16,D,Mem[S:O]);
13:ShowFall (3,X,Y,LenX,LenY,16,D,Mem[S:O]);
14:ShowFall (4,X,Y,LenX,LenY,10,D,Mem[S:O]);
15:ShowFlow (1,X,Y,LenX,LenY,2,D,Mem[S:O]);
16:ShowFlow (2,X,Y,LenX,LenY,2,D,Mem[S:O]);
17:ShowFlow (3,X,Y,LenX,LenY,2,D,Mem[S:O]);
18:ShowFlow (4,X,Y,LenX,LenY,2,D,Mem[S:O]);
19:ShowIn (X,Y,LenX,LenY,2,D,Mem[S:O]);
20:ShowJam (1,X,Y,LenX,LenY,10,D,Mem[S:O]);
21:ShowJam (2,X,Y,LenX,LenY,16,D,Mem[S:O]);
22:ShowJam (3,X,Y,LenX,LenY,16,D,Mem[S:O]);
23:ShowJam (4,X,Y,LenX,LenY,10,D,Mem[S:O]);
24:ShowLine (1,X,Y,LenX,LenY,D,Mem[S:O]);
25:ShowLine (2,X,Y,LenX,LenY,D,Mem[S:O]);
26:ShowMove (1,X,Y,LenX,LenY,2,D,Mem[S:O]);
27:ShowMove (2,X,Y,LenX,LenY,4,D,Mem[S:O]);
28:ShowScroll(1,X,Y,LenX,LenY,4,D,Mem[S:O]);
29:ShowScroll(2,X,Y,LenX,LenY,5,D,Mem[S:O]);
30:ShowScroll(3,X,Y,LenX,LenY,5,D,Mem[S:O]);
31:ShowScroll(4,X,Y,LenX,LenY,4,D,Mem[S:O]);
32:ShowShadow(X,Y,LenX,LenY,199,D,Mem[S:O]);
33:ShowShadow(X,Y,LenX,LenY,211,D,Mem[S:O]);
34:ShowShadow(X,Y,LenX,LenY,307,D,Mem[S:O]);
35:ShowSlope (X,Y,LenX,LenY,D,Mem[S:O]);
36:ShowSplit (1,X,Y,LenX,LenY,10,D,Mem[S:O]);
37:ShowSplit (2,X,Y,LenX,LenY,10,D,Mem[S:O]);
38:ShowSplit (3,X,Y,LenX,LenY,10,D,Mem[S:O]);
39:ShowSplit (4,X,Y,LenX,LenY,10,D,Mem[S:O]);
40:ShowZoom (X,Y,LenX,LenY,2,D,Mem[S:O]);
41:ShowZoom2 (X,Y,LenX,LenY,2,D,Mem[S:O]);
42:ShowZoom4 (1,X,Y,LenX,LenY,4,D,Mem[S:O]);
43:ShowZoom4 (2,X,Y,LenX,LenY,5,D,Mem[S:O]);
44:ShowZoom4 (3,X,Y,LenX,LenY,5,D,Mem[S:O]);
45:ShowZoom4 (4,X,Y,LenX,LenY,4,D,Mem[S:O]);
46:ShowZoomXY(1,X,Y,LenX,LenY,2,D,Mem[S:O]);
47:ShowZoomXY(2,X,Y,LenX,LenY,4,D,Mem[S:O]);
end;
FreeMem(Pic,64768);
end;
{ ─────────────── Help ─────────────── }
procedure Help(X,Y:integer); { 40x11 }
var Buf:array[0..3999] of byte;
begin
GetText(X,Y,41,12,Buf);
TextWin2(X,Y,40,11,Co[11],Co[12],1,'Help');
PrintText(X+3,Y+2,Co[10],'1,2 ── Change colors');
PrintText(X+3,Y+3,Co[10],'Cursors,Enter ── Select');
PrintText(X+3,Y+4,Co[10],'+,-,*,/ ── Delay');
PrintText(X+3,Y+5,Co[10],'Esc ── Exit');
PrintText(X+3,Y+7,Co[10],'VGA Show V1.1 /320x200,256 Colors');
PrintText(X+3,Y+8,Co[10],'Copyright (C) 1994 by Jou-Nan Chen');
K:=Key; K:=0;
PutText(X,Y,41,12,Buf);
end;
{ ─────────────── TextProc ─────────────── }
procedure TextProc;
begin
SetMode(0);
SetTextFont(16,0,256,Font1);
SetCurShape($20,0);
SetFlash(0);
end;
{ ─────────────── Screen ─────────────── }
procedure Screen;
const C:array[0..16] of byte=(
0,1,16,17,12,33,6,7, 11,25,26,27,44,37,54,63, 0);
begin
SetPalette17(C);
TextWin2(1,1,80,25,Co[4],Co[5],0,'VGA Show Version 1.1');
TextBar(2,2,78,23,Co[1],' ');
TextBox(2,3,78,22,Co[4],1);
PrintText(8,2,Co[6],' ▄▄▄▄ ▄ ▄▄▄▄▄▄ ▄ ');
PrintText(8,3,Co[6],' ▀▄ █▄▄▄█ █ █ █ ▄ █ ');
PrintText(8,4,Co[6],'▄▄▄▀ █ █▄█▄▄▄▀ █▀ ▀█ ');
PrintText(35,4,Co[4],'F1-Help');
end;
{ ─────────────── ShowPage ─────────────── }
procedure ShowPage(PageNo:integer); { 5x17 }
var I:integer;
begin
PageMax:=PageSize-1;
if (Max<PageSize-1) or (Page=Max div PageSize) then PageMax:=Max mod PageSize;
TextBar(4,8,74,15,Co[1],' ');
for I:=0 to PageMax do
PrintText(5+15*(I mod 5),6+I div 5,Co[1],Filenames[PageSize*PageNo+I]);
end;
{ ─────────────── SelectType ─────────────── }
procedure SelectType(X,Y:integer); { 58x17 }
const St:array[0..47] of string[11]=(
'Bars 16->1 ','Outside ','Inside ','Circle Out ',
'Circle In ','Rnd Cells ','Clock Rnd ','Clock Line ',
'Clock 2Line','Color Shade','Random Dots','Fall Up ',
'Fall Left ','Fall Right ','Fall Down ','Flow Up ',
'Flow Left ','Flow Right ','Flow Down ','In 4 Parts ',
'Jam Up ','Jam Left ','Jam Right ','Jam Down ',
'Lines U-D ','Lines L-R ','Move U-D ','Move L-R ',
'Scroll Up ','Scroll Left','Scroll Rght','Scroll Down',
'Shadow Smal','Shadow Mid ','Shadow Big ','Lines Slope',
'Split Up ','Split Left ','Split Rght ','Split Down ',
'Zoom Out ','Zoom In ','Zoom Up ','Zoom Left ',
'Zoom Right ','Zoom Down ','Zoom U-D ','Zoom L-R ');
var I:integer;
Buf:array[0..3999] of byte;
begin
GetText(X,Y,59,17,Buf);
TextWin2(X,Y,58,16,Co[8],Co[9],1,' Show Type ');